import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import axios from 'axios'
import TreeTAble from 'vue-table-with-tree-grid'
import VueQuillEditor from 'vue-quill-editor'

// require styles
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
/* 引入进度条 */
import NProgress from 'nprogress'
/* 进度条样式 */
import 'nprogress/nprogress.css'
Vue.use(VueQuillEditor, /* { default global options } */)

Vue.component('tree-table', TreeTAble)
/* 在请求展示进度条 */
axios.interceptors.request.use(config => {
  NProgress.start();
  config.header.Authorization = window.sessionStorage.getItem('token');
  return config;
})
/*  请求结束后关闭进度条*/
axios.interceptors.response.use(config=>{
  NProgress.done();
  return config;
})
Vue.config.productionTip = false;
axios.defaults.baseURL = "https://192.168.1.1";
Vue.prototype.axios = axios;

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
